package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt");
        String str = "你是什么的干活!";
        byte[] buf = str.getBytes(StandardCharsets.UTF_8);
        fos.write(buf);
        str = "大大的干活！";
        buf = str.getBytes(StandardCharsets.UTF_8);
        fos.write(buf);
        fos.close();
    }
}
